@import "./automatic/theme.scss";

html, body, #root {height: 100%;}

$black-85: rgba($color: $black, $alpha: .85);
$black-65: rgba($color: $black, $alpha: .65);
$black-45: rgba($color: $black, $alpha: .45);
$black-25: rgba($color: $black, $alpha: .25);

$px-16:16px;
$px-8:8px;
$px-20:20px;

.title-text {
  color: $black-85;
  font-size: 16px;
  font-weight: bold;
}

.routeAnimation {
  position: relative;
  height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  top: 2px;
  left: 2px;
  opacity: 0;
}

@keyframes showPage {
  to {
    top: 0;
    left: 0;
    opacity: 1;
  }
}

.routeAnimation-enter-done {
  animation: showPage 0.3s ease forwards;
  -webkit-animation: showPage 0.3s ease forwards;
}

.page-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: $custom-space;
  box-shadow:0px 8px 40px 0px rgba(224,229,238,0.5);
  border-radius:$border-radius-base $border-radius-base 0px;
  background: #FFF;
}

.common-block {
  margin: $custom-space $custom-space + 4;
  padding: 0 $custom-space $custom-space;
  border-radius: $border-radius-base;
  background: #FFF;
}

.common-flex {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 0;
  overflow: hidden;
}

.common-scroll-view {
  flex: 1;
  height: 0;
  overflow-y: auto;

  [class^="table_table"] {
    height: auto;
  }
}

.common-center { // 居中
  align-items: center;
  justify-content: center
}

.common-block-table {
  @extend .common-block;
  @extend .common-flex;
}

.common-link {
  display: inline-block;
  margin-left: $custom-space;
  color: $primary-color;
  font-size: 14px;
  cursor: pointer;
  &:first-child {
    margin-left: 0;
  }
  &:hover {
    text-decoration: underline;
  }
}

// mock input 样式
.common-mock-input {
  height: 32px;
  line-height: 32px;
  border: 1px solid #EEE;
  border-radius: 2px;
  background-color: #f5f5f5;
  cursor: not-allowed;
  text-indent: 10px;
  color: rgba(0, 0, 0, 0.45);
}

.common-white-space {
  height: calc($custom-space / 2);
}

.wingBlank {
  display: inline-block;
  width: calc($custom-space / 2);
}

// 使用common-white-space替代whiteSpace，这里保留是为了兼容已使用的老项目
.whiteSpace {
  display: block;
  @extend .common-white-space;
}

:global {
  .ant-layout.ant-layout-has-sider {
    height: 100%;
  }

  .ant-select-item-option.ant-select-item-option-selected{
    color: $primary-color !important;
    background:#E6F7FF;
    font-weight: normal;
  }

  .ant-menu-sub.ant-menu-inline {
    background: #FFF;
  }

  .ant-menu-title-content {
    margin-left: 0 !important;
  }

  .ant-select-item-option{
    color: $black-65 !important;
  }

  .ant-message-notice-content{
    font-size: 14px;
  }

  .ant-input-suffix,.ant-picker-clear { // input suffixIcon 时间选择 icon的 color
    color: $black-45;
  }

  .ant-upload-list-item-name { // upload控件 fileName color
    color: $black-65;
  }

  .ant-table-placeholder { // table 无数据时 去除底部线条
    .ant-table-cell {
      border-bottom: none !important;
    }
  }

  .ant-drawer-header {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    font-weight: 500;

    .ant-drawer-close {
      padding-top: 18px;
      padding-bottom: 18px;
    }
  }

  .ant-form-item {
    flex-wrap: nowrap !important;
    margin-bottom: 8px !important;
  }

  .ant-table-thead > tr > th {
    font-weight: 500;
  }

  .ant-picker {
    padding: 4px 7px 4px 11px;
  }

  .ant-col.ant-form-item-control { // 溢出隐藏 disabled的框右边距对齐
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    .ant-select-disabled .ant-select-arrow,
    .ant-cascader-picker-disabled .ant-cascader-picker-arrow {
      display: none;
    }

    .ant-select-selection-item {
      // display: block !important;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .ant-select-disabled .ant-select-selection-item {
      padding-right: 0 !important;
    }
  
    .ant-input-disabled {
      padding-right: 11px !important;
    }
  
    .ant-cascader-picker-disabled .ant-cascader-picker-label {
      padding-right: 12px !important;
    }
  }

  .ant-modal-body {
    padding: 14px 24px 24px !important;
  }

  .ant-picker,.ant-input-affix-wrapper.ant-select-selection-search-input {
    padding-right: 8px !important;
  }
}


.ant-select-multiple .ant-select-selection-item-content {
  font-weight: 400;
}

.ant-col.ant-form-item-control .ant-input-disabled,
input[disabled],
.ant-input[disabled],
.ant-input-disabled,
.ant-radio-disabled + span,
.ant-checkbox-disabled + span,
.ant-col.ant-form-item-control .ant-select-disabled .ant-select-selection-item,
.ant-col.ant-form-item-control .ant-cascader-picker-disabled .ant-cascader-picker-label {
  color: rgba(0, 0, 0, 0.45) !important;
}

::placeholder,
.ant-select-selection-placeholder {
  font-weight: 400 !important;
  color: rgba(0, 0, 0, 0.25) !important;
  opacity: 1 !important;
}

:-moz-placeholder {
  color: rgba(0, 0, 0, 0.25) !important;
}

::-moz-placeholder {
  color: rgba(0, 0, 0, 0.25) !important;
}

#FORM_ERROR_SCROLL {
  position: relative;
}